package com.urea.system.service.impl;

import java.util.List;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.urea.system.mapper.PayInfoMapper;
import com.urea.system.domain.PayInfo;
import com.urea.system.service.IPayInfoService;

/**
 * 交易记录Service业务层处理
 * 
 * @author liuzd
 * @date 2023-08-01
 */
@Service
public class PayInfoServiceImpl extends ServiceImpl<PayInfoMapper, PayInfo> implements IPayInfoService
{
    @Autowired
    private PayInfoMapper payInfoMapper;

    /**
     * 查询交易记录
     * 
     * @param id 交易记录主键
     * @return 交易记录
     */
    @Override
    public PayInfo selectPayInfoById(Long id)
    {
        return payInfoMapper.selectPayInfoById(id);
    }

    /**
     * 查询交易记录列表
     * 
     * @param payInfo 交易记录
     * @return 交易记录
     */
    @Override
    public List<PayInfo> selectPayInfoList(PayInfo payInfo)
    {
        return payInfoMapper.selectPayInfoList(payInfo);
    }

    /**
     * 新增交易记录
     * 
     * @param payInfo 交易记录
     * @return 结果
     */
    @Override
    public int insertPayInfo(PayInfo payInfo)
    {
        return payInfoMapper.insertPayInfo(payInfo);
    }

    /**
     * 修改交易记录
     * 
     * @param payInfo 交易记录
     * @return 结果
     */
    @Override
    public int updatePayInfo(PayInfo payInfo)
    {
        return payInfoMapper.updatePayInfo(payInfo);
    }

    /**
     * 批量删除交易记录
     * 
     * @param ids 需要删除的交易记录主键
     * @return 结果
     */
    @Override
    public int deletePayInfoByIds(Long[] ids)
    {
        return payInfoMapper.deletePayInfoByIds(ids);
    }

    /**
     * 删除交易记录信息
     * 
     * @param id 交易记录主键
     * @return 结果
     */
    @Override
    public int deletePayInfoById(Long id)
    {
        return payInfoMapper.deletePayInfoById(id);
    }


    @Override
    public List<PayInfo> sevenPayInfoByDate(Long userId, Long agentId, Long storeId) {
        return payInfoMapper.sevenPayInfoByDate(userId,agentId,storeId);
    }

    @Override
    public List<PayInfo> sevenAgentInfoByDate(Long userId, Long agentId, Long storeId) {
        return payInfoMapper.sevenAgentInfoByDate(userId,agentId,storeId);
    }

    @Override
    public PayInfo payInfo(String orderNo) {
        return lambdaQuery().eq(PayInfo::getOrderNo,orderNo).one();
    }
}
